home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pyr_johplatform.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  199 lines

  1. # Jones 3D Cog Script
  2. #
  3. # pyr_johplatform.cog
  4. #    
  5. # Timed platform that closes under the Jewel of Heaven in pyramid 4
  6. #
  7. # [RKD]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13. message    startup
  14. message    activated
  15. message    entered
  16. message    exited
  17. message    timer
  18. message    crossed
  19.  
  20. # world things
  21. thing    platform        nolink
  22. thing    button            
  23. thing    player            local
  24.  
  25. # cameras
  26. thing    buttoncam        nolink
  27. thing    platformcam        nolink
  28.  
  29. # camera lookthings
  30. thing    platformcamlook    nolink
  31.  
  32. # various ghosts
  33. thing    plasmaGhost        nolink
  34.  
  35. # where the jewel stream will turn on
  36. surface    jeweltrigger    linkid=3
  37. sector    jewelsector1    linkid=3
  38. sector    jewelsector2    linkid=3
  39. sector    jewelsector3    linkid=3
  40.  
  41. # hint 51 uses the overdoor surface to work
  42. thing    hint51            nolink
  43.  
  44. surface    overdoor    linkid=2
  45. surface    underdoor    linkid=2
  46.  
  47. material    mat0=gen_4aplasma_jewel.mat    local       # animating plasma texture
  48.  
  49. sound    platsnd=nub_2mstep_move_c.wav    local
  50. sound    platstop=nub_weight_stop_c.wav    local
  51.  
  52. int        oktoclose=1            local
  53. int        locked=0            local
  54.  
  55. # subroutines
  56. flex    startscene=0.0    local
  57. flex    endscene=0.0    local
  58. flex    fixcams=0.0        local
  59. end
  60.  
  61.  
  62. code
  63. startup:    
  64.     SetThingLight(platform, '.5 .5 1', .001, .01);
  65.     return;
  66.  
  67. activated:
  68. # ---> button
  69.  
  70.     if (GetSenderRef() == jeweltrigger) return;
  71.     if (locked) return;
  72.     locked = 1;
  73.     
  74.     # start cutscene
  75.     player = GetLocalPlayerThing();
  76.     DeselectWeaponWait(GetLocalPlayerThing());
  77.     call startscene;
  78.  
  79.     # animate plasma material
  80.     MaterialAnim(mat0, 9.0, 1);
  81.     
  82.     # player presses button
  83.     SetExtCamOffsetToThing(buttoncam);
  84.     PlayMode(player, 60, 0);
  85.     sleep(.5);
  86.     
  87.     # move button in
  88.     MoveToFrame(button, 1, 1);
  89.     
  90.     sleep(.5);
  91.  
  92.     SetCameraFocus(2, platformcam);
  93.     SetCameraSecondaryFocus(2, platformcamlook);
  94.     SetCurrentCamera(2);
  95.     SetCameraFOV(100, 0, 0);
  96.         
  97.     sleep(.5);
  98.  
  99.     # open platform
  100.     PlaySoundThing(platsnd, platform, 1, -1, -1, 0);
  101.     MoveToFrame(platform, 1, 1);
  102.     
  103.     SetCameraFOV(70, 1, 2);
  104.     
  105.     WaitForStop(platform);
  106.     PlaySoundThing(platstop, platform, 1, -1, -1, 0);
  107.  
  108.     sleep(1);
  109.     
  110.     # set timer to make door close again
  111.     # timer ranges from 20 on easy to 40 on hard
  112.     SetTimer(40 - (4 * GetDifficulty()));
  113.  
  114.     # end cutscene
  115.     call endscene;
  116.  
  117.     return;
  118.  
  119. entered:
  120. # ---> jeweltrigger, jewelsectors
  121.     
  122.     if (GetSenderID() != 3) return;
  123.  
  124.     if (GetCurFrame(platform) == 1)
  125.     {
  126.         JewelFlyingStatus(1, plasmaGhost);    
  127.     }
  128.  
  129.     return;
  130.  
  131. exited:
  132. # ---> jeweltrigger, jewelsectors
  133.     
  134.     if (GetSenderID() != 3) return;
  135.  
  136.     JewelFlyingStatus(0, plasmaGhost);
  137.     return;
  138.     
  139. crossed:
  140.     if (GetSenderRef() == overdoor)
  141.     {
  142.         oktoclose = 0;
  143.         SetHintSolved(hint51);
  144.     }
  145.     else if (GetSenderRef() == underdoor)
  146.     {
  147.         oktoclose = 1;
  148.     }
  149.  
  150.     return;
  151.     
  152. startscene:
  153.     call fixcams;
  154.     StartCutscene(1);
  155.     StopThing(player);
  156.     SetActorFlags(player, 0x200000);
  157.             
  158.     return;
  159.                 
  160. endscene:
  161.     ClearActorFlags(player, 0x200000);
  162.  
  163.     SetCurrentCamera(1);
  164.     
  165.     call fixcams;
  166.     EndCutscene();
  167.     return;
  168.     
  169. fixcams:
  170.     #reset camera settings
  171.     ResetCameraFOV(0, 0);
  172.     SetCameraPosInterp(2, 0);
  173.     SetCameraLookInterp(2, 0);
  174.     RestoreExtCam();
  175.     return;
  176.  
  177. timer:
  178.     # if the plasmaghost is out of play or player is below the lightroom and column
  179.     if ((GetThingFlags(plasmaghost) & 0x80000) && (oktoclose == 1))
  180.     {
  181.         JewelFlyingStatus(0, plasmaghost);
  182.         
  183.         PlaySoundThing(platsnd, platform, 1, -1, -1, 0);
  184.         MoveToFrame(platform, 0, 2);
  185.         MoveToFrame(button, 0, 2);
  186.         WaitForStop(platform);
  187.         PlaySoundThing(platstop, platform, 1, -1, -1, 0);
  188.     
  189.         locked = 0;
  190.     }
  191.     else
  192.     {
  193.         SetTimer(5);
  194.     }
  195.  
  196.     return;
  197.  
  198. end
  199.